<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue常用指令测试</title>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(item,index) in list" :key="index" v-if="index %2==0">{{index}}---{{item}}</li>
        <li v-for="(value,key) in user">{{key}}---{{value}}</li>
        <li v-for="(item,index) in userList" :key="item.user.name">
            <div v-if="item.user.name=='zhangsan'" style="background: #0094ff">
                {{index}}---{{item.user.name}}
            </div>
            <div v-else="">
                {{index}}---{{item.user.name}}
            </div>

        </li>
    </ul>
</div>

</body>
<script src="vue.js"></script>
<script>
    var Vm = new Vue({
        el: '#app',
        data: {
            list: [1, 2, 3, 4, 5],
            user: {name: 'zhangsan', age: 10},
            userList: [
                {user: {name: 'zhangsan', age: 10}},
                {user: {name: 'lisi', age: 11}},
                {user: {name: 'wangwu', age: 12}}
            ]
        }
    });
</script>
</html>